@extends('master')
@section('title')
<title>我的主页</title>
@endsectioin
@section('style')
<style>
	body{background: #f7f8fa;}
	#content{margin-top: 80px;}
	#people-nav{height: 60px;border-bottom: 1px solid #ddd;margin:0px;}
	#people-nav>.col-md-10{padding: 16px 0;position: relative;}
	#people-nav>.col-md-10 li{line-height: 30px;}
	#people-nav>.col-md-10 li a{font-size: 14px;color: #aaa;text-decoration: none;padding:0 5px;}
	#user-card>.col-md-12{border: 1px solid #ddd;padding: 0px;background: white;}
	#user-card-list{position: relative;height: 150px;z-index: 10;}
	#user-card-list .img-thumbnail{position: absolute;top: -30px;left: 20px;border-radius: 10px;}
	#user-cart-edit-btn{position: absolute;bottom: -20px;right: -50px;}
	#user-card-more{position: absolute;bottom: -30px;left: 40px;font-size: 12px;border: 0px;}
	#user-content{padding: 0px;border: 1px solid #ddd;background: white;}
	#user-main-title{line-height: 50px;border-bottom: 1px solid #ddd;}
	#user-item{border-bottom: 1px solid #ddd;}
	#user-item-author{color: #999;line-height: 20px;}
	#user-item-footer{font-size: 12px;padding: 0px;}
	#user-item-xq img{border-radius: 5px;padding: 10px 0px;}
	#user-item-text{font-size: 12px;color: #666;line-height: 25px;}
	#user-flist{padding-right: 0px;}
	#user-flist .col-md-12:first-child{padding: 10px 0px;background: white;border: 1px solid #ddd;}
	#user-flist a{color: #999;text-decoration: none;cursor: pointer;line-height: 30px;}
	#user-flist a:hover{color: #0f88eb;text-decoration: none;}
	#user-flist .user-fl{line-height: 40px;border-top: 1px solid #ddd;cursor: pointer;padding: 6px 0px;}
	#user-flist .user-fl:hover{color: #0f88eb;}
	#content #bgImg{cursor: pointer;}
	.clearfix{height: 20px;}
	/*文章动态 样式*/
	#content .item{height: 200px;border-bottom: 1px solid #ddd;padding: 10px 0px;font-size: 12px;}
	#content .item .col-md-1{height: 240px;padding: 10px;}
	#content .item .col-md-1 .btn{background: #EFF6FA;height: 20px;padding: 0px 10px;margin-top: 10px;}
	#content .item .col-md-1 .btn:hover{background: #ddd;}
	#content .item .col-md-12{padding: 0px;}
	#content .item .col-md-11 span,#item .col-md-11 h5{color: #999;}
	#content .item .col-md-11 .col-md-12{cursor: pointer;}
	#content .item #item-text{line-height: 25px; height: 125px;overflow: hidden;text-overflow:ellipsis;}
</style>
@endsection
@section('content')
<div id="content" class="container">
<!-- 用户资料卡 start -->
	<div id="user-card" class="col-md-12">
		<div class="col-md-12">
			<img id="bgImg" width="100%" height="240" src="{{$user->datail->image}}" alt="">
		</div>
		<script>
			var uploader = new plupload.Uploader({
				browse_button:'bgImg',
				url:'/api/bgImgUpload'
			});
			uploader.init();
			uploader.bind('FilesAdded',function(uploader,files){
		    	uploader.start();
		    });
		    uploader.bind('FileUploaded',function(uploader,files, res){
		    	if(res.response != '0'){
			    	var img = res.response;
			    	$('#bgImg').attr('src', img);
			    }
		    });
		</script>
		<div id="user-card-list" class="col-md-12">
			<img width="160" class="img-thumbnail" src="{{$user->face}}" alt="">
			<div class="col-md-9 col-md-offset-2">
				<div class="col-md-12">
					<div class="col-md-6"><h2>{{$user->name}}</h2></div>
					<!-- <span class="col-md-8"><h4>好好学习, 天天向上! </h4></span> -->
				</div>
				<div class="col-md-12">
					<span class="col-md-8">
						<span id="icon" class="glyphicon glyphicon-tags"></span><span>{{$user->datail->autograph}}</span>
					</span>
				</div>
				<div class="col-md-12">
					<span class="col-md-8">
						<span id="icon" class="glyphicon glyphicon-user"></span><span>{{$user->datail->school}}</span>
					</span>
				</div>
				<!-- <div id="user-card-more" class="btn btn-default btn-xs"><span id="icon" class="glyphicon glyphicon-chevron-down"></span>查看详细资料</div> -->
				<!-- <a href="/setting" id="user-cart-edit-btn" class="btn btn-info">编辑个人资料</a> -->
			</div>
		</div>
	</div>
<!-- 用户资料卡 end -->
<!-- 内容主题栏 start -->
	<div class="col-md-12">
	<div class="clearfix"></div>
		<!-- 左侧内容栏 start -->
		<div id="user-content" class="col-md-8">
			<!-- <ul class="nav nav-tabs">
				<li role="presentation"><a href="/people?index=0">动态</a></li>
				<li role="presentation"><a href="/people?index=1">收藏</a></li>
				<li role="presentation"><a href="/people?index=2">关注</a></li>
				<li role="presentation"><a href="/people?index=3">评论</a></li>
				<li role="presentation"><a href="/people?index=4">发表</a></li>
				<li role="presentation"><a href="/people?index=5">关注</a></li>
			</ul> -->
			<div id="user-main" class="col-md-12">
				<div id="user-main-title" class="col-md-12">
					<b>我的动态</b>
				</div>
				<!-- 动态详情 -->
				@foreach($logs as $k=>$v)
					@if($v->class == 1)
						@include('dongtai.user', ['user'=>$v->users])
					@elseif($v->class == 2)
						@include('dongtai.article', ['article'=>$v->articles, 'log'=>$v])
					@elseif($v->class == 3)
						@include('dongtai.question', ['question'=>$v->questions, 'log'=>$v])
					@elseif($v->class == 4)
						@include('dongtai.topic', ['user'=>$v->topics])
					@elseif($v->class == 5)
						@include('dongtai.column', ['user'=>$v->columns])
					@endif
				@endforeach
				<div class="col-md-12 text-right">
				{!! $logs->render() !!}
				</div>
			</div>
		</div>
		<!-- 左侧内容栏 end -->
		<!-- 右侧工具栏 start -->
		<div id="user-flist" class="col-md-4">
			<div class="col-md-12">
				<span class="col-md-6 text-center"><a href=""><b>关注了<br><span>0</span></b></a></span>
				<span class="col-md-6 text-center"><a href=""><b>关注者<br><span>0</span></b></a></span>
			</div>
			<div class="clearfix col-md-12"></div>
			<div class="col-md-12 user-fl">
				<div class="col-md-6">关注的话题</div>
				<div class="col-md-6 text-right">0</div>
			</div>
			<div class="col-md-12 user-fl">
				<div class="col-md-6">关注的专栏</div>
				<div class="col-md-6 text-right">0</div>
			</div>
			<div class="col-md-12 user-fl">
				<div class="col-md-6">关注的问题</div>
				<div class="col-md-6 text-right">0</div>
			</div>
			<div class="col-md-12 user-fl">
				<div class="col-md-6">关注的收藏夹</div>
				<div class="col-md-6 text-right">0</div>
			</div>
			<div class="col-md-12" style="border-top: 1px solid #ddd;">
				<span id="flink" style="color: #999;">
					<span><a href="#">刘看山</a></span> |
					<span><a href="#">知乎指南</a></span> |
					<span><a href="#">建议反馈</a></span> |
					<span><a href="#">移动应用</a></span> |
					<span><a href="#">加入知乎</a></span> |
					<span><a href="#">知乎协议</a></span> |
					<span><a href="#">举报投诉</a></span> |
					<span><a href="#">联系我们</a></span>
				</span><br>
				<span style="color: #999;">© 2017 知乎</span>
			</div>
		</div>
		<!-- 右侧工具栏 end -->
	</div>
<!-- 内容主题栏 end -->
</div>
@endsection